package com.etlmaster.datax.plugins.writer.hbasewriter;

import org.apache.hadoop.fs.Path;

import com.dp.nebula.wormhole.common.interfaces.IParam;
import com.dp.nebula.wormhole.common.interfaces.ISourceCounter;
import com.dp.nebula.wormhole.common.interfaces.ITargetCounter;
import com.dp.nebula.wormhole.common.interfaces.IWriterPeriphery;
import com.etlmaster.executor.bigdata.hbase.Environment;
import com.etlmaster.executor.bigdata.hbase.HbaseUtil;


/**
 * @author Wugf
 * @date 2016-11-10
 */
public class HbaseWriterPeriphery implements IWriterPeriphery {

	public void prepare(IParam param, ISourceCounter counter) {
		
		String hadoopCoreSiteFile=Environment.CORE_SITE;
		String hadoopHdfsSiteFile=Environment.HDFS_SITE;
		String hbasePath=Environment.HBSE_SITE;
		Path path=new Path(hadoopCoreSiteFile);
		Path hdfsPath=new Path(hadoopHdfsSiteFile);
		
		Path hbaseSitePath=new Path(hbasePath);
		HbaseUtil.getConf().addResource(path);
		HbaseUtil.getConf().addResource(hdfsPath);
		HbaseUtil.getConf().addResource(hbaseSitePath);

	}

	public void doPost(IParam param, ITargetCounter counter) {
		// TODO Auto-generated method stub

	}

	public void rollback(IParam param) {
		// TODO Auto-generated method stub

	}

}